import { createRouter, createWebHistory} from 'vue-router'
const routes = [
  {
    path:'/login',
    name:'login',
    component:()=>import('@/views/login/index.vue'),
    meta:{
      title:'首页',
      icon:'HomeFilled',
      isShow:false
    }
  },
  {
    path:'/',
    redirect:'/layout',
    meta:{
      isShow:false
    }
  },
 
 /** 
  *  
  */
   
]
export const asyncRoutes = [
  {
    path:'/layout',
    name:'layout',
    component:()=>import('@/layout/index.vue'),
    redirect:'/layout/welcome',
    meta:{
      isShow:true
    },
    children:[
      {
        //首页
        path:'/layout/welcome',
        name:'welcome',
        component:()=>import('@/views/home/index.vue'),
        meta:{
          title:'首页',
          icon:'HomeFilled'
        }
      },
      //到时候进行菜单权限时，将以下路由写到一个新的文件里
      {
        //班级管理
        path:'/layout/class',
        name:'class',
        component:()=>import('@/views/ClassManger/index.vue'),
        meta:{
          title:'班级管理',
          icon:'School'
        }
      },
      //学生管理
      {
        path:'/layout/student',
        name:'student',
        component:()=>import('@/views/student/index.vue'),
        meta:{
          title:'学生管理',
          icon:'UserFilled'
        }
      },
      //老师管理
      {
        path:'/layout/teacher',
        name:'teacher',
        component:()=>import('@/views/teacher/index.vue'),
        meta:{
          title:'老师管理',
          icon:'User'
        }
      },
      {
        //文件管理
        path:'/layout/file',
        name:'file',
        component:()=>import('@/views/FileManger/index.vue'),
        meta:{
          title:'文件管理',
          icon:'Files'
        }
      },
      {
        //作业管理
        path:'/layout/work',
        name:'work',
        component:()=>import('@/views/homework/index.vue'),
        meta:{
          title:'作业管理',
          icon:'Document'
        }
      },
      //职位管理
      {
        path:'/layout/job',
        name:'job',
        component:()=>import('@/views/JobManger/index.vue'),
        meta:{
          title:'职位管理',
          icon:'Odometer'
        }
      },
      //菜单管理
      {
        path:'/layout/menu',
        name:'menu',
        component:()=>import('@/views/roleManger/MenuManger/index.vue'),
        meta:{
          title:'菜单管理',
          icon:'Menu'
        }
      },
      //按钮管理
      {
        path:'/layout/button',
        name:'button',
        component:()=>import('@/views/roleManger/BtnManger/index.vue'),
        meta:{
          title:'按钮管理',
          icon:'Setting'
        }
      }

    ]
  },
]
const router = createRouter({
  history:createWebHistory(),
  routes
})

export default router
export {
  routes
}